<!DOCTYPE html>
<html lang="en">

<head>
  <meta charset="UTF-8">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <title>Document</title>
</head>

<body>
  <script>
    let arr = ['red', 'yellow', 'black']
    arr[0] = 'pink' //把red改为pink
    console.log(arr)
    for (let i = 0; i < arr.length; i++) {
      arr[i] = arr[i] + '老师'
    }
    console.log(arr)
  </script>
</body>

</html>